import path from 'path';

export const getDbPath = (n) => {
    const upDirs = Array.from({ length: n }, () => '..');
    return path.resolve(process.cwd(), ...upDirs);
}

// 定义用户数据文件存储路径
export const setFilePath = (n, relativePath) => {
    const dbPath = getDbPath(n);
    return path.resolve(dbPath, relativePath);
}